package com.hfut.eeg.controller;

import com.hfut.eeg.common.api.CommonResult;
import com.hfut.eeg.service.SysInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;

/**
 * @author 梁琦
 * @program: eeg
 * @Package com.hfut.eeg.controller
 * @Description: TODO
 * @date 2019-11-05 16:45
 */
@Controller
@Api(tags = "SysInfoController", value = "系统信息")
@RequestMapping("/home")
public class SysInfoController {
    @Autowired
    private SysInfoService sysInfo;

    @ApiOperation("获取系统信息")
    @RequestMapping(value = "/sysInfo")
    @ResponseBody
    public CommonResult sysInfo(){
        HashMap result = sysInfo.getSysInfo();
        if (result==null){
            return CommonResult.failed("获取系统信息失败");
        }else {
            return CommonResult.success(result);
        }
    }
}
